package com.scott.conf;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("nacos")
public class ConfController {

    // 使用@Value("${teacher.phone}") 读取配置文件[bootstrap.properties]中的属性[teacher.phone=13267128038]

    @Value("${teacher.name}")
    private String name;

    @Value("${teacher.phone}")
    private String phone;

    // 备注 项目启动前先要启动nacos
    // http://localhost:8080/nacos/hello
    @GetMapping("hello")
    public String hello(){
        return "{name="+name+" ,phone="+phone+"}";
    }


}
